//
// Created by 11510 on 2024/6/19.
//
#include <iostream>

using namespace std;

class Base1 {
public:
    Base1() : _iBase1(10) { cout << "Base1()" << endl; }

    virtual void f() {
        cout << "Base1::f()" << endl;
    }

    virtual void g() {
        cout << "Base1::g()" << endl;
    }

    virtual void h() {
        cout << "Base1::h()" << endl;
    }

    virtual ~Base1() {}

private:
    double _iBase1;
};

class Base2 {
//...
public:
    virtual void g1() {
        cout << "Base2::g1()" << endl;
    }

private:
    double _iBase2;
};

class Base3 {
public:
    virtual void g1() {
        cout << "Base3::g1()" << endl;
    }
//...
private:
    double _iBase3;
};

class Derived : public Base1, public Base2, public Base3 {
public:
    Derived() : _iDerived(10000) { cout << "Derived()" << endl; }

    void f() {
        cout << "Derived::f()" << endl;

    }

    void g1() {
        cout << "Derived::g1()" << endl;
    }

private:
    double _iDerived;
};

int main(void) {

    cout << sizeof(Derived) << endl;

    Derived d;
    Base1 *pBase1 = &d;
    Base2 *pBase2 = &d;
    Base3 *pBase3 = &d;

    cout << "&Derived = " << &d << endl;
    cout << "pBase1 = " << pBase1 << endl;
    cout << "pBase2 = " << pBase2 << endl;
    cout << "pBase3 = " << pBase3 << endl;
    return 0;
}
